/*
 * @Author: 徐建辰
 * @Date: 2022-02-15 15:38:32
 * @LastEditTime: 2022-02-16 10:14:14
 * @LastEditors: 徐建辰
 * @Description: 订单请求模块
 */
import request from './request'

// 创建订单
export const createOrder = data => request({
  url: '/saveOrder',
  method: 'post',
  data
})

// 获取订单列表
export const getOrders = params => request({
  url: '/order',
  params
})

// 支付订单
export const payOrder = params => request({
  url: '/paySuccess',
  params
})

// 获取订单详情
export const getDetailById = id => request({url: `/order/${id}`})

// 取消订单
export const cancelOrder = id => request.put(`/order/${id}/cancel`)

// 确认订单
export const confirmOrder = id => request.put(`/order/${id}/finish`)

